package cn.gson.crm.model.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import cn.gson.crm.model.pojo.Customerinfo; 

public interface LLJ_CustomerinfoDao  extends CrudRepository<Customerinfo,Long>{

	@Query("select new cn.gson.crm.model.pojo.Customerinfo(c.custId,c.cjustKinds,"    
			+ "c.custAddress,c.custCname,c.custCreatedata3,c.custCycle,c.custName,"
			+ "c.custOperat,c.custPhone,c.custRemarks,c.custSrc,custUpdate) from Customerinfo c where c.custCname like?1") 
	public List<Customerinfo> searchAllByName(String key);  
	
	@Query("select new cn.gson.crm.model.pojo.Customerinfo(c.custId,c.cjustKinds,c.custAddress,"
			+ "c.custCname,c.custCreatedata3,c.custCycle,c.custName,c.custOperat,c.custPhone,"
			+ "c.custRemarks,c.custSrc,c.custUpdate) from Customerinfo c order by c.id desc")
	public List<Customerinfo> searchAllData();    
} 
     